package com.joysuch.wwyt.config;

import com.github.yitter.contract.IdGeneratorOptions;
import com.github.yitter.idgen.YitIdHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description //TODO
 * @Date 2022/12/6 16:55
 * @Author Leong
 **/
@Configuration
public class IdGeneratorConfig {

    @Bean
    public void initIdGenerator() {
        IdGeneratorOptions options = new IdGeneratorOptions((short) 1);
        options.WorkerIdBitLength=2;
        options.SeqBitLength=12;
        YitIdHelper.setIdGenerator(options);
    }
}
